from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

op = webdriver.ChromeOptions()
op.add_experimental_option("excludeSwitches",["enable-automation"])
op.add_experimental_option("useAutomationExtension",False)
op.add_argument('--start-maximized')
driver = webdriver.Chrome(options = op)

driver.get(r"http://118.121.200.162:8085/index")
sleep(2)
driver.find_element(By.XPATH,'//*[@id="navbar"]/div/ul/li[1]/a').click()
sleep(2)
driver.find_element(By.XPATH,'//*[@id="userID"]').send_keys("qk")
sleep(2)
driver.find_element(By.XPATH,'//*[@id="password"]').send_keys("King20020827@")
sleep(2)
driver.find_element(By.XPATH,'//*[@id="submit"]').click()
sleep(3)

alert = driver.switch_to.alert.accept()
sleep(2)

qk=driver.find_element(By.XPATH,'//*[@id="navbar"]/div/ul/li[1]/a/p')
qk34 = qk.text
print(qk34)
sleep(2)

assert "King20020827" in qk34

driver.quit()